package ldh.im.fxbase.util;

public class AudioUtil {

    private static int spikesensitivity = 50;
    private static int sens = 7;
    private static byte smoothedValue = 0;
    private static int smoothing = 2;

    public static byte[] removeNoise(byte[] b, int length) {
        byte[] returnThis = new byte[b.length];
        for( int i = 0; i < length; i++){
            smoothedValue += (b[i] - smoothedValue) / smoothing;
            returnThis[i] = smoothedValue;
        }
        return returnThis;
    }
}
